@prefix-cls: ~'@{namespace}-multiple-tabs';
@prefix-cls-default-layout: ~'@{namespace}-default-layout';

.@{prefix-cls-default-layout}-out {
  &.ant-layout-auto-collapse-tabs {
    .@{prefix-cls} {
      // margin-top: -(@multiple-height + 2);
      opacity: 0.1;

      &:hover,
      &--hover {
        margin-top: 0;
        transition-delay: 0s;
        opacity: 1;
      }
    }
  }
  .@{prefix-cls} {
    transition:
      margin 0.2s ease-in-out 0.6s,
      opacity 0.2s ease-in-out 0.6s;
  }
}

.@{prefix-cls} {
  @apply my-2;

  z-index: 10;

  .ant-tabs.ant-tabs-card {
    .ant-tabs-nav {
      // height: @multiple-height + 2;
      margin: 0;
      padding: 0 1rem;
      box-shadow: none;

      &::before {
        border: 0;
      }

      .ant-tabs-tab {
        padding: 3px 16px;
        transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
        border-radius: 6px;
        background-color: #f7f8fa;
        color: var(--ant-color-text-base);

        &:hover {
          .ant-tabs-tab-remove {
            svg {
              fill: black;
            }
          }
        }

        .ant-tabs-tab-remove {
          margin-left: 0;
          font-size: 14px;

          svg {
            fill: #00000073;
          }
        }
      }

      .ant-tabs-tab:not(.ant-tabs-tab-active) {
        &:hover {
          border-color: var(--ant-color-primary) !important;
          color: var(--ant-color-primary);
        }
      }

      .ant-tabs-tab-active {
        position: relative;
        border-color: var(--ant-color-primary) !important;

        span {
          color: var(--ant-color-primary);
        }

        svg {
          width: 0.7em;
          fill: black;
        }
      }
    }

    .ant-tabs-nav > div:nth-child(1) {
      .ant-tabs-tab {
        @apply !not-first:mx-6px first:mr-6px last:mr-0;
      }
    }
  }

  .ant-tabs-tab:not(.ant-tabs-tab-active) {
    .anticon-close {
      font-size: 14px;

      svg {
        width: 0.7em;
      }
    }
  }

  .ant-dropdown-trigger {
    display: inline-flex;
  }

  &--hide-close {
    .ant-tabs-tab-remove {
      // opacity: 0 !important;
      display: none;
    }
  }

  &-content {
    &__extra-quick,
    &__extra-redo,
    &__extra-fold {
      display: inline-block;
      width: @multiple-height;
      height: @multiple-height;
      margin-right: 6px;
      border-radius: 6px;
      background-color: var(--ant-color-bg-container);
      color: var(--ant-color-text-secondary);
      line-height: @multiple-height;
      text-align: center;
      cursor: pointer;

      &:hover {
        color: var(--ant-color-text-base);
      }

      span[role='img'] {
        transform: rotate(90deg);
      }
    }

    &__extra-fold {
      @apply !mr-0;
    }

    &__extra-redo {
      span[role='img'] {
        transform: rotate(0deg);
      }
    }

    &__info {
      display: inline-block;
      width: 100%;
      cursor: pointer;
      user-select: none;
    }
  }
}

.ant-tabs-dropdown-menu {
  &-title-content {
    display: flex;
    align-items: center;

    .@{prefix-cls} {
      &-content__info {
        width: auto;
        margin-left: 0;
        line-height: 28px;
      }
    }
  }

  &-item-remove {
    margin-left: auto;
  }
}

.multiple-tabs__dropdown {
  .ant-dropdown-content {
    width: 172px;
  }
}
